﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Security;
using System.Web;
using IHISCETeim.Library;
using IHISCETeim.Model;
using IHISCETeim.DAL;
using System.Data;
namespace IHISCETeim.BLL
{
    public enum SAuditLevelType
    { 
        DWF
    }
    public  class SAuditLevelController
    {
        public static List<SAuditLevelInfo> GetByType(SAuditLevelType Type)
        {
            return GetByType(Type.ToString());
        }

        /// <summary>
        /// 获取审核类型下所有审批级别
        /// </summary>
        /// <param name="Type"></param>
        /// <returns></returns>
        private static List<SAuditLevelInfo> GetByType(string Type)
        {
            return CBO.FillCollection<SAuditLevelInfo>(SAuditLevelDAL.GetByType(Type));
        }

        /// <summary>
        /// 获取单条信息
        /// </summary>
        /// <param name="Type"></param>
        /// <param name="ID"></param>
        /// <returns></returns>
        public static SAuditLevelInfo GetAditlvlById(SAuditLevelType Type, int ID)
        {
            List<SAuditLevelInfo> list = GetByType(Type);
             SAuditLevelInfo obj ;
            try
            {
                obj = list.First(e => e.AdtlvlID == ID);
            }
            catch
            {
                obj = new SAuditLevelInfo();
            }
            return obj;

        }
    }
}
